package huawei0814;

import java.util.HashMap;
import java.util.Scanner;

/**
 * Created by JiaJia on 2019/8/14 0014.
 */
public class CountChar {
    public static void main(String[] args) {
        /*Scanner scanner=new Scanner(System.in);
        while (scanner.hasNext()){
            String s=scanner.nextLine();
            String[] str=new String[];
            int index=0;
            int cnt=0;
            int sinx=0;
            while (index<s.length()-1){
                char c=s.charAt(index);
                if (String.valueOf(c).matches("[a-zA-Z]")){
                    cnt++;
                    str[sinx]=String.valueOf(c);
                }else if (String.valueOf(c).matches("[1-9]")){
                    StringBuilder sb=new StringBuilder();
                    sb.append(c);
                    while (String.valueOf(s.charAt(index+1)).matches("[1-9]")){
                        sb.append(s.charAt(index+1));
                        index++;
                    }
                    str[sinx]=sb.toString();
                    cnt++;
                }else if (String.valueOf(c).matches("[!@#$%^&*()]")){
                    cnt++;
                    str[sinx]=String.valueOf(c);
                }else if (String.valueOf(c).matches("\"")){

                }
            }

        }
        scanner.close();*/
        int num=-21;
        String s=Integer.toBinaryString(num);
        System.out.println(s);
        int count=0;
        HashMap<Integer,Integer> map=new HashMap<>();
        for (int i = s.length()-1; i >=2 ; i--) {
            if (s.charAt(i)=='1'&&s.charAt(i-1)=='0'&&s.charAt(i-2)=='1'){
                count++;
                map.put(count,i);
            }
        }

        int index=map.get(1);
        int result=s.length()-index-1;
        System.out.println(count+" "+result);

    }

}